﻿<?php  $this->load->view('admin/tcategory/link_bar');?>

		<form method="post" action="<?php echo base_url()?>admin/tcategory/delete" class="form">
		<input id="submitFiltercategory" name="submitFiltercategory" value="0" type="hidden">
		
 <div class="box_function">
		
			<table width="747" border="0" cellpadding="0" cellspacing="0" class="listproduct" id="listproduct">
				<tbody>
				<tr>
					<td class="tilte_list_pro">
						<input name="checkme" class="noborder" onclick="checkDelBoxes(this.form, 'categoryBox[]', this.checked)" type="checkbox">
					</td>
					
					<td class="tilte_list_pro">
						<?php echo lang('name');?>
					</td>
					<td class="tilte_list_pro">
						<?php echo lang('best_sell_product');?>
					</td>
                    <td class="tilte_list_pro">
						<?php echo lang('specials');?>
					</td>
                    <td class="tilte_list_pro">
						<?php echo lang('active');?>
					</td>
					<td class="tilte_list_pro">
						<?php echo lang('action');?>
					</td>
				</tr>
				
				<?php
				for($i = 0; $i < count($rows); $i++){
					$id = $rows[$i]->id_pcategory;
					$name = $rows[$i]->vi_name;
					$code = $rows[$i]->code;
					$description = $rows[$i]->vi_description;
					$parent = $rows[$i]->code;
					if($parent=='') $parent = '_';
					$active = $rows[$i]->active; //== 1 ? "checked.jpg" : "nocheck.jpg";
                    $best_sell = $rows[$i]->best_sell;
                    $special = $rows[$i]->special;
					//$items .= eval ($this->loadTemplate('admin/pcategory/pcategory_item.tpl'));

                     if($i % 2 == 0) $css_class = 'row1';
                            else $css_class = 'row2';
                            
				?>
				<tr class="<?php echo $css_class ?>">
					<td class="product">
						<input name="categoryBox[]" value="<?php echo $id?>" class="noborder" type="checkbox">
					</td>
					
					<td class="product" onclick="document.location = '#'">
					<?php echo $name?>
					</td>
					
					<td class="product center" onclick="document.location = '#'">
                       <input  type="checkbox" onclick="xajax_changeBestSell(<?php echo $id?>);" name="cs<?php echo $id?>" <?php echo $best_sell==1?'checked':''?>>
					</td>
                    <td class="product center" onclick="document.location = '#'">
						<input  type="checkbox" onclick="xajax_changeSpecial(<?php echo $id?>);" name="cs<?php echo $id?>" <?php echo $special==1?'checked':''?>>
					</td>
                    <td class="product center" onclick="document.location = '#'">
						<input  type="checkbox" onclick="xajax_changeDisplay(<?php echo $id?>);" name="cs<?php echo $id?>" <?php echo $active==1?'checked':''?>>
					</td>
					<td class="product center">
						
						<a href="<?php echo $this->base_url?>admin/pcategory/edit/<?php echo $id?>">
							<img src="<?php echo $this->base_url?>images/admin/edit.gif" alt="Edit" title="Edit" border="0">
						</a>
	
						<a href="<?php echo $this->base_url?>admin/pcategory/delete/<?php echo $id?>" onclick="return confirm('Delete item #<?php echo $id?>?');">
						<img src="<?php echo $this->base_url?>images/admin/delete.gif" alt="Delete" title="Delete" border="0">
						</a>
					</td>
				</tr>
				<?php
				}
				?>
					
				</tbody>
			</table>
			
			<p>
			<input class="button" name="submitDelcategory" value="Delete selection" onclick="return confirm('Delete selected items?');" type="submit">
			</p>
			
		
</div>
</form>